package java.Dao;

import entity.KnowledgeBaseMember;

import java.sql.SQLException;
import java.util.List;

/**
 * @Author Su
 * @Date 2025/4/29 21:50
 * @Version 1.0 （版本号）
 */
public interface KnowledgeBaseMemberDAO {
    /**
     * 添加成员
     */
    boolean addMember(int knowledgeBaseId, int userId, String role) throws SQLException;

    /**
     * 移除成员
     */
    boolean removeMember(int knowledgeBaseId, int userId) throws SQLException;

    /**
     * 更新成员角色
     */
    boolean updateMemberRole(int knowledgeBaseId, int userId, String role) throws SQLException;

    /**
     * 检查用户是否是知识库管理员
     */
    boolean isAdmin(int knowledgeBaseId, int userId) throws SQLException;

    /**
     * 检查用户是否是知识库成员
     */
    boolean isMember(int knowledgeBaseId, int userId) throws SQLException;

    /**
     * 获取知识库成员列表
     */
    List<KnowledgeBaseMember> listMembers(int knowledgeBaseId) throws SQLException;
}